<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>评价管理</title>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
    <%@include file="../../include/commonFile.jsp" %>
</head><body>
<!--头部-->
<%@include file="../../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <form class="layui-form" action="${ctx}/mall/order/evaluateList.do" id="myForm" method="post">
                <input type="hidden" name="pageNo" id="pageNo" value="${page.page}"/>
                <div class="f-search-bar">
                    <div class="search-container">
                        <ul class="search-form-content">
                            <li class="form-item"><label class="search-form-lable">类型</label>
                                <div class="check-btn-inner">
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),'','#myForm')" ${empty type ? 'class="active"' : ''}>全部</a>
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),'2','#myForm')" ${type == '2' ? 'class="active"' : ''}>好评</a>
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),'3','#myForm')" ${type == '3' ? 'class="active"' : ''}>中评</a>
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),'4','#myForm')" ${type == '4' ? 'class="active"' : ''}>差评</a>
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),'5','#myForm')" ${type == '5' ? 'class="active"' : ''}>有图评价</a>
                                    <input type="hidden" name="type" value="${type}"/>
                                </div>
                            </li>
                        </ul>
                        <ul class="search-form-content">
                            <li class="form-item"><label class="search-form-lable">评价时间</label>
                                <div class="check-btn-inner" id="timeType">
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),0,'#myForm')" ${empty input.timeType || input.timeType == 0 ? 'class="active"' : ''}>全部</a>
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),1,'#myForm')" ${input.timeType == 1 ? 'class="active"' : ''}>今天</a>
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),2,'#myForm')" ${input.timeType == 2 ? 'class="active"' : ''}>本周内</a>
                                    <a href="javascript:void(0);" onclick="setTimeType($(this),3,'#myForm')" ${input.timeType == 3 ? 'class="active"' : ''}>本月内</a>
                                    <input type="hidden" name="timeType" value="${input.timeType}"/>
                                </div>
                                <div class="layui-inline">
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createStart" value="${input.createStart}" placeholder="开始日">
                                    </div>
                                    -
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createEnd" value="${input.createEnd}" placeholder="截止日">
                                    </div>
                                </div>
                            </li>
                            <li class="form-item-inline">
                                <div class="sub-btns">
                                    <a class="layui-btn layui-btn-danger" href="javascript:submitFunction('#myForm')">查询</a>
                                    <a class="layui-btn layui-btn-normal" href="javascript:resetFunction('#myForm')">重置</a>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </form>
            <div class="my-act-list-content mt20">
                <div class="cl">
                    <table class="layui-table">
                        <colgroup>
                            <col width="140">
                            <col width="140">
                            <col width="100">
                            <col width="50">
                            <col width="120">
                            <col width="120">
                            <col width="90">
                            <col width="50">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>订单号</th>
                            <th>商品名称</th>
                            <th>评价者</th>
                            <th>评价类型</th>
                            <th>评价内容</th>
                            <th>评价图片</th>
                            <th>评价时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:if test="${page.totalCount == 0}">
                            <tr>
                                <td colspan="8">
                                    <div class="f16 tc">没有更多记录了...</div>
                                </td>
                            </tr>
                        </c:if>
                        <c:forEach var="entity" items="${evaluateList}">
                            <tr>
                                <td>
                                    <div>${entity.orderId}</div>
                                </td>
                                <td title="${entity.goodsName}">
                                    <div class="ellipsis-1">${entity.goodsName}</div>
                                </td>
                                <td>
                                    <div class="member-cell" onclick="openDialogShow('用户名片','${ctx}/system/member/memberView.do?id=${entity.updateBy}','400px','470px')">
                                        <div class="member-logo" style="background-image: <c:if test="${entity.logo != null}">url('${entity.logo}?imageMogr2/auto-orient/crop/126x126'),</c:if>url(${ctx}/image/def_user_logo.png)"></div>
                                        <div class="member-name ellipsis-1">
                                            <a title="${entity.realname}" href="javascript:void(0);">${entity.realname}</a>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    <div>
                                        <c:choose>
                                            <c:when test="${entity.level == 1}">好评</c:when>
                                            <c:when test="${entity.level == 2}">中评</c:when>
                                            <c:when test="${entity.level == 3}">差评</c:when>
                                        </c:choose>
                                    </div>
                                </td>
                                <td>
                                    <div>${entity.content}</div>
                                </td>
                                <td>
                                    <div>
                                        <c:if test="${not empty entity.pic}">
                                            <c:forEach var="pic" items="${fn:split(entity.pic, ',')}">
                                                <img src="${pic}" style="width: 50px; height: 50px;"/>
                                            </c:forEach>
                                        </c:if>
                                    </div>
                                </td>
                                <td>
                                    <div><fmt:formatDate value="${entity.updateDate}" pattern="yyyy-MM-dd HH:mm"/></div>
                                </td>
                                <td class="opts-btns tb-opts" style="width: 150px">
                                    <div class="comm-opts">
                                        <a class="green"
                                           href="javascript:txz.deleteObject('确定要删除该评价吗？', '${ctx}/mall/order/deleteEvaluate.do?id=${entity.id}', '')">删除</a>
                                    </div>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div><!--底部-->
        <%@include file="../../include/footer.jsp" %>
    </section>
</div>

<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    showActive('${input.createStart}', '${input.createEnd}', '#timeType');
    $(function(){
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        // 查询发布日期
        var start = {
            elem: 'input[name=createStart]'
        };

        var end = {
            elem: 'input[name=createEnd]'
        };
        laydate.render(start);
        laydate.render(end);
    });
    })
</script>
<script type="text/javascript">
    txz.initHeader({
        nav:[{
            name: '评价管理',
            curr: true
        }],
        info:'<span class="f12">共<b id="totalCount">${page.totalCount}</b>条记录</span>'
    });
</script>
</body>
</html>